home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / game / shoot / kill_em.lha / KILL_EM!!! / GAME < prev    next >
Encoding:
Text File  |  2002-01-15  |  9.1 KB  |  536 lines

  1. G4C ;$VER: KILL_EM!!! V1.40 (15.01.2002)
  2.  
  3.  
  4. WinBig -1 -1 320 256 ""
  5. WinType 00001000
  6. WinBackGround Solid 1 0
  7.  
  8.  
  9. xOnLoad
  10.    set tbmargins 5/4
  11.  
  12.    makescreen KILL_EM 320/256/6/0x21000/newtopaz.font/8 "KILL_EM Screen"
  13.  
  14.    setscreen #this KILL_EM
  15.  
  16.    movescreen #this 10000 0
  17.  
  18.    guiopen #this
  19.  
  20.    setpointer #this hide
  21.  
  22.    loadimage $$this.path\GFX/BACKDROP backdrop *
  23.  
  24.    changeimage #this 200 -1 -1 backdrop
  25.  
  26.    cli "sys:prefs/sound $$this.path\DATA/SilentBeep use"
  27.  
  28.    loadimage $$this.path\GFX/BADGUY1  badguy1  *
  29.    loadimage $$this.path\GFX/BADGUY2  badguy2  *
  30.  
  31.    loadimage $$this.path\GFX/COP      cop      *
  32.    loadimage $$this.path\GFX/LADY     lady     *
  33.  
  34.    loadimage $$this.path\GFX/RIP      rip      *
  35.    loadimage $$this.path\GFX/SURPRISE surprise *
  36.  
  37.    loadimage $$this.path\GFX/+500     plus500  *
  38.    loadimage $$this.path\GFX/-500     minus500 *
  39.    loadimage $$this.path\GFX/TIME+    moretime *
  40.    loadimage $$this.path\GFX/TIME-    lesstime *
  41.  
  42.    loadimage $$this.path\GFX/RMB      rmb      noremap
  43.    loadimage $$this.path\GFX/POINTER  pointer  noremap
  44.  
  45.    loadsound $$this.path\SFX/Scream.smp     scream
  46.    loadsound $$this.path\SFX/Pistol.smp     pistol
  47.    loadsound $$this.path\SFX/Ricochet.smp   ricochet
  48.    loadsound $$this.path\SFX/EvilLaugh.smp  evillaugh
  49.    loadsound $$this.path\SFX/Explosion1.smp explosion
  50.    loadsound $$this.path\SFX/Collect.smp    collect
  51.    loadsound $$this.path\SFX/GlassSmash.smp glasssmash
  52.  
  53.    hiscore = 0
  54.    time    = 0
  55.  
  56.    gosub #this show_title
  57.  
  58.    delay 25
  59.  
  60.    setpointer #this #rmb
  61.  
  62.  
  63. xonclose
  64.    guiquit #this
  65.  
  66.  
  67. xonquit
  68.    cli "sys:prefs/sound envarc:sys/sound.prefs use"
  69.  
  70.    setpointer #this default
  71.  
  72.    freeimage backdrop
  73.    freeimage badguy1
  74.    freeimage badguy2
  75.    freeimage lady
  76.    freeimage rmb
  77.    freeimage rip
  78.    freeimage cop
  79.    freeimage surprise
  80.    freeimage pointer
  81.    freeimage plus500
  82.    freeimage minus500
  83.    freeimage moretime
  84.    freeimage lesstime
  85.    
  86.  
  87.    freesound scream
  88.    freesound pistol
  89.    freesound ricochet
  90.    freesound evillaugh
  91.    freesound explosion
  92.    freesound collect
  93.    freesound glasssmash
  94.  
  95.    killscreen KILL_EM
  96.  
  97.    quit
  98.  
  99.  
  100.  
  101. image 0 0 ""
  102.    gadid 200
  103.  
  104.  
  105. image 94 79 ""
  106.    gadid 1
  107.  
  108.  
  109. xarea 94 79 40 50 none
  110.    if $game != 0
  111.       playsound pistol
  112.       hit = 1
  113.       gosub #this shoot
  114.    endif
  115.    gadid 2
  116.  
  117.  
  118.  
  119. xonrmb
  120.    if $game != 0
  121.    or $quit != 0
  122.       stop
  123.    endif
  124.  
  125.    gosub #this clear_title
  126.  
  127.    playsound evillaugh
  128.  
  129.    setpointer #this #pointer
  130.  
  131.    time    = 90
  132.    game    = 1
  133.    run     = 1
  134.    hit     = 0
  135.    score   = 0
  136.  
  137.    maxtime = $time
  138.  
  139.    setgad #this 10 on
  140.  
  141.    update #this 99 "HiScore: $hiscore - Score: $score - Time: $time secs"
  142.  
  143.    partredraw #this 0 0 0 0
  144.  
  145.    gosub #this newpos
  146.  
  147.  
  148.  
  149. xonclick
  150.    gosub #this missed
  151.  
  152. xondoubleclick
  153.    gosub #this missed
  154.  
  155.  
  156. xroutine missed
  157.    if $game = 1
  158.       playsound pistol
  159.       hit = 0
  160.       gosub #this shoot
  161.       playsound ricochet
  162.    endif
  163.  
  164.  
  165.  
  166. xroutine shoot
  167.    flash
  168.  
  169.    if $hit = 1
  170.       if $obj = badguy1
  171.          playsound scream
  172.          score = $(($score + $pts) + 25)
  173.          changeimage #this 1 $x $y rip
  174.       elseif $obj = badguy2
  175.          playsound scream
  176.          score == $score + $pts
  177.          changeimage #this 1 $x $y rip
  178.       else
  179.          changeimage #this 1 $x $y $obj
  180.       endif
  181.  
  182.       if $obj = lady
  183.          playsound scream
  184.          score = 0
  185.          changeimage #this 1 $x $y rip
  186.       elseif $obj = cop
  187.          playsound scream
  188.          changeimage #this 1 $x $y rip
  189.          time = 0
  190.          gosub #this timer
  191.          stop
  192.       endif
  193.  
  194.       if $obj = plus500
  195.          playsound collect
  196.          score == $score + 500
  197.       endif
  198.  
  199.       if $obj = minus500
  200.       and $score >= 500
  201.          playsound glasssmash
  202.          score == $score - 500
  203.       elseif $obj = minus500
  204.       and $score >= 500
  205.          playsound glasssmash
  206.          score = 0
  207.       endif
  208.  
  209.       if $obj = moretime
  210.       and $time <= $($maxtime - 10)
  211.          playsound collect
  212.          time == $time + 10
  213.          score == $score + 250
  214.       elseif $obj = moretime
  215.       and $time > $($maxtime - 10)
  216.          playsound collect
  217.          score == $score + 250
  218.          time = $maxtime
  219.       endif
  220.  
  221.       if $obj = lesstime
  222.       and $time >= 10
  223.          playsound glasssmash
  224.          time == $time - 10
  225.       elseif $obj = lesstime
  226.       and $time >= 10
  227.          playsound glasssmash
  228.          if $score >= 100
  229.             score == $score - 250
  230.          endif
  231.          time = 0
  232.       endif
  233.    elseif $hit = 0
  234.    and $score >= 100
  235.       score == $score - 100
  236.    elseif $hit = 0
  237.    and $score < 100
  238.       score = 0
  239.    endif
  240.  
  241.  
  242.    if $hit = 1
  243.       setgad #this 2 hide
  244.       partredraw #this 0 0 0 0
  245.  
  246.       delay 10
  247.  
  248.       setgad #this 1 hide
  249.       partredraw #this 0 0 0 0
  250.    endif
  251.  
  252.    update #this 99 "HiScore: $hiscore - Score: $score - Time: $time secs"
  253.    partredraw #this 0 0 0 0
  254.  
  255.  
  256. xroutine newpos
  257.    setgad #this 1/2 hide
  258.    partredraw #this 0 0 0 0
  259.  
  260.    randpos = $$rand.3
  261.    randobj = $$rand.27
  262.  
  263.    if $randpos = 0
  264.       x = 94
  265.       y = 79
  266.       pts = 100
  267.    elseif $randpos = 1
  268.       x = 12
  269.       y = 185
  270.       pts = 125
  271.    elseif $randpos = 2
  272.       x = 250
  273.       y = 103
  274.       pts = 150
  275.    elseif $randpos = 3
  276.       x = 204
  277.       y = 175
  278.       pts = 175
  279.    endif
  280.  
  281.    if $randobj <= 10
  282.       obj = badguy1
  283.    elseif $randobj >= 11
  284.    and $randobj < 21
  285.       obj = badguy2
  286.    elseif $randobj = 22
  287.       obj = plus500
  288.    elseif $randobj = 23
  289.       obj = minus500
  290.    elseif $randobj = 24
  291.       obj = moretime
  292.    elseif $randobj = 25
  293.       obj = lesstime
  294.    elseif $randobj = 26
  295.       obj = lady
  296.    elseif $randobj = 27
  297.       obj = cop
  298.    endif
  299.  
  300.    if $obj = badguy1
  301.    or $obj = badguy2
  302.    or $obj = lady
  303.    or $obj = cop
  304.       changeimage #this 1 $x $y $obj
  305.    else
  306.       changeimage #this 1 $x $y surprise
  307.    endif
  308.  
  309.    changegad #this 2 $x $y 40 50 ""
  310.  
  311.    setgad #this 1/2 show
  312.  
  313.    partredraw #this 0 0 0 0
  314.  
  315.  
  316.  
  317. xtimer repeat 0:0:1 off
  318.    gosub #this timer
  319.       gadid 10
  320.  
  321.  
  322. xroutine timer
  323.    if $time = 0
  324.       gosub #this game_over
  325.  
  326.       delay 300
  327.  
  328.       gosub #this clear_title
  329.  
  330.       delay 50
  331.  
  332.       gosub #this show_title
  333.  
  334.       delay 25
  335.  
  336.       setpointer #this #rmb
  337.    else
  338.       --time
  339.  
  340.       gosub #this newpos
  341.  
  342.       update #this 99 "HiScore: $hiscore - Score: $score - Time: $time secs"
  343.  
  344.       partredraw #this 0 0 0 0
  345.    endif
  346.  
  347.  
  348.  
  349. xtextbox -1 240 320 16 "" ""
  350.    attr tbstyle 14/42/shadow/center
  351.    attr tbox 2/1/-1/none
  352.       gadfont times.font 13 000
  353.          gadid 99
  354.  
  355.  
  356. xtextbox -1 -1 320 44 "" ""
  357.    attr tbstyle 44/47/shadow/center
  358.    attr tbox 2/1/-1/none
  359.       gadfont adel.font 32 000
  360.          gadid 100
  361.  
  362.  
  363. xtextbox -1 150 320 22 "" ""
  364.    attr tbstyle 32/20/outline/center
  365.    attr tbox 2/1/-1/none
  366.       gadfont baselcb.font 16 000
  367.          gadid 101
  368.  
  369.  
  370.  
  371. xroutine show_title
  372.    run  = 0
  373.    game = 0
  374.    quit = 0
  375.  
  376.    delay 20
  377.    update #this 100 "KILL_EM!!!"
  378.    playsound explosion
  379.  
  380.    delay 40
  381.    update #this 101 "Press <RMB> to start!"
  382.    playsound explosion
  383.  
  384.    delay 40
  385.    setgad #this 99 show
  386.    update #this 99 "©2001/2002 by Nightshade (thenightshade@freenet.de)"
  387.    playsound explosion
  388.  
  389.    partredraw #this 0 0 0 0
  390.  
  391.  
  392. xroutine clear_title
  393.    if $game = 1
  394.       setgad #this 99 hide
  395.    elseif $game = 0
  396.       update #this 99 ""
  397.    endif
  398.  
  399.    update #this 100 ""
  400.    update #this 101 ""
  401.  
  402.    partredraw #this 0 0 0 0
  403.  
  404.  
  405. xroutine game_over
  406.    setgad #this 10 off
  407.  
  408.    setgad #this 99 hide
  409.  
  410.    partredraw #this 0 0 0 0
  411.  
  412.    if $score > $hiscore
  413.       hiscore = $score
  414.    endif
  415.  
  416.    setpointer #this hide
  417.  
  418.    playsound evillaugh
  419.  
  420.    update #this 100 "GAME OVER!"
  421.  
  422.    update #this 101 "Your Score: $score"
  423.  
  424.    setgad #this 1/2 hide
  425.  
  426.    setgad #this 100/101 show
  427.  
  428.    partredraw #this 0 0 0 0
  429.  
  430.  
  431.  
  432. xonkey p
  433.    if $run = 1
  434.       if $game = 1
  435.          playsound explosion
  436.  
  437.          setgad #this 10 off
  438.  
  439.          setgad #this 99 hide
  440.  
  441.          gosub #this clear_title
  442.  
  443.          setgad #this 100/101 show
  444.  
  445.          update #this 100 "GAME PAUSED!"
  446.  
  447.          update #this 101 "Press <P> again!"
  448.  
  449.          partredraw #this 0 0 0 0
  450.  
  451.          game = 0
  452.       else
  453.          setgad #this 100/101 hide
  454.  
  455.          setgad #this 99 show
  456.  
  457.          partredraw #this 0 0 0 0
  458.  
  459.          setgad #this 10 on
  460.  
  461.          game = 1
  462.       endif
  463.    endif
  464.  
  465.  
  466. xonkey q
  467.    if $game = 0
  468.    and $time = 0
  469.    and $quit = 0
  470.       playsound explosion
  471.  
  472.       setpointer #this hide
  473.  
  474.       update #this 100 ""
  475.       update #this 101 ""
  476.  
  477.       update #this 99 "Really quit? (y/n)"
  478.  
  479.       partredraw #this 0 0 0 0
  480.  
  481.       quit = 1
  482.    elseif $game = 1
  483.       time = 0
  484.       gosub #this timer
  485.    endif
  486.  
  487.  
  488. xonkey n
  489.    if $quit = 1
  490.    and $game = 0
  491.       update #this 99 ""
  492.  
  493.       partredraw #this 0 0 0 0
  494.  
  495.       gosub #this show_title
  496.  
  497.       setpointer #this #rmb
  498.  
  499.       quit = 0
  500.    endif
  501.  
  502.  
  503. xonkey y
  504.    if $quit = 1
  505.    and $game = 0
  506.       gosub #this clear_title
  507.  
  508.       setpointer #this hide
  509.  
  510.       playsound explosion
  511.       update #this 100 "THE END!!!"
  512.       partredraw #this 0 0 0 0
  513.  
  514.       delay 40
  515.       playsound explosion
  516.       update #this 101 "Good bye..."
  517.       partredraw #this 0 0 0 0
  518.  
  519.       delay 40
  520.  
  521.       playsound explosion
  522.       if $hiscore > 0
  523.          update #this 99 "Your HiScore: $hiscore"
  524.       else
  525.          update #this 99 "See you later!!!"
  526.       endif
  527.  
  528.       partredraw #this 0 0 0 0
  529.  
  530.       delay 200
  531.  
  532.       playsound scream
  533.  
  534.       guiclose #this
  535.    endif
  536.